package cn.house.action;

import cn.house.pojo.Users;
import cn.house.service.UsersService;
import com.opensymphony.xwork2.Action;

public class LoginAction implements Action {

    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    private Users user;

    public Users getUser() {
        return user;
    }

    public void setUser(Users user) {
        this.user = user;
    }

    private UsersService service=new UsersService();

    @Override
    public String execute() throws Exception {

        boolean balg=service.Login(user);

        if (balg){
            return Action.SUCCESS;
        }else{
            this.setMessage("账号或者密码错误！");
            return Action.ERROR;
        }

    }
}
